package demo.jdbc.example;

import demo.jdbc.example.dao.UsersDao;
import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "ServletDeleteTest", value = "/ServletDeleteTest")
public class ServletDeleteTest extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 删除操作
        UsersDao usersDao = new UsersDao();

        boolean flag = usersDao.delete(99);

        PrintWriter out = response.getWriter();

        out.println(flag);

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
